package com.william.springsecurity.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class UserController {

//    @RequestMapping("/addRoleToUser")
//    public String addRoleToUser(Integer[] ids, Integer userId){
//        //从后台获取到当前认证通过后的用户名
//        SecurityContextHolder.getContext().getAuthentication().getName();
//        String username = ((SysUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getUsername();
//        userService.addRoleToUser(userId, ids);
//        return "redirect:toAddRolePage?success="+true+"&id="+userId;
//    }


}
